<?php

declare(strict_types=1);

namespace App\Service;

use App\JsonRpc\RpcDemoServiceInterface;
use Hyperf\Di\Annotation\Inject;
use Hyperf\Retry\Annotation\Retry;

class DemoService
{
    #[Inject]
    protected RpcDemoServiceInterface $rpcDemoService;

    #[Retry]
    public function testAdd(): int
    {
        return $this->rpcDemoService->add(mt_rand(1, 100), mt_rand(1, 100));
    }

    #[Retry]
    public function test(): array
    {
        return $this->rpcDemoService->test();
    }
}
